package cn.micai.base.io;

import java.io.File;
import java.io.IOException;

/**
 * 描述：
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/6/20 14:20
 */
public class CreateFileExample {

    public static void main(String [] args) {
        try {
            File file = new File("D://newFile.txt");
            if (file.createNewFile()) {
                System.out.println("File is created!");
            } else {
                System.out.println("File already exists.");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
